﻿using System;
using System.Diagnostics.Contracts;

namespace CardGameFramework
{
    public interface ICard : IEquatable<Card>
    {
    }

    public class Card : ICard
    {
        public Suits Suit { get; private set; }
        public Ranks Rank { get; private set; }

        public Card(Suits suit, Ranks rank)
        {
            Suit = suit;
            Rank = rank;
        }

        public string Label
        {
            get
            {
                return String.Format("{0}{1}", Suit.GetLabel(), Rank.GetLabel());
            }
        }


        #region IEquatable<Card> Members

        public bool Equals(Card other)
        {
            if (other == null) return false;
                return Label.Equals(other.Label);
        }

        #endregion
    }
}
